package com.example.testpic;

import java.util.List;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ListView;

public class SendPicActivity extends Activity {
	
	private Button selectImageButton;
	private List<String> resultBitmaps;
	private ListView sendImageListView;
	private SendImageItemAdapter sendImageItemAdapter;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.send_image_layout);
		selectImageButton = (Button) findViewById(R.id.select_image_btn);
		selectImageButton.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(SendPicActivity.this, AlbumListActivity.class);
				startActivity(intent);
				SendPicActivity.this.finish();
			}
		});
		Intent resultIntent = getIntent();
		if (resultIntent != null) {
			resultBitmaps = (List<String>) resultIntent.getSerializableExtra("selectedImages");
		}
		sendImageListView = (ListView) findViewById(R.id.send_content);
		sendImageItemAdapter = new SendImageItemAdapter(this, resultBitmaps);
		sendImageListView.setAdapter(sendImageItemAdapter);
	}
	
	@Override
	protected void onDestroy() {
		// TODO Auto-generated method stub
		super.onDestroy();
	}
}
